package com.gxa.modules.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxa.common.base.RespResult;
import com.gxa.common.constants.Constants;
import com.gxa.common.util.TimeSlotUtil;
import com.gxa.modules.dto.*;
import com.gxa.modules.entity.*;
import com.gxa.modules.mapper.*;
import com.gxa.modules.service.ContractService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import javax.persistence.criteria.CriteriaBuilder;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Controller
public class ContractServiceImpl extends ServiceImpl<ContractMapper,CrmContract> implements ContractService {

    @Autowired
    private ContractMapper contractMapper;

    @Autowired
    private MyEmployeeMapper myEmployeeMapper;

    @Autowired
    private ContractTypeMapper contractTypeMapper;

    @Autowired
    private MyCustomerMapper myCustomerMapper;

    @Autowired
    private ContractAppendixMapper contractAppendixMapper;

    @Autowired
    private RenewalRecordMapper renewalRecordMapper;

    /**
     * 分页查询合同信息
     * @param currentPage
     * @param pageSize
     * @return
     */
    @Override
    public RespResult queryAllContractsByPage(int currentPage, int pageSize) {
        QueryWrapper<CrmContract> contractQueryWrapper = new QueryWrapper<>();
        contractQueryWrapper.eq("deleted_state", Constants.UNDELETED);
        Page<CrmContract> page = new Page<>(currentPage,pageSize);
        IPage<CrmContract> crmContractIPage = contractMapper.selectPage(page, contractQueryWrapper);
        List<ContractDTO> contractDTOList = getContractVO(crmContractIPage.getRecords());
        return RespResult.success(contractDTOList);
    }

    /**
     * 查询今日新增的合同列表
     * @param currentPage
     * @param pageSize
     * @return
     */
    @Override
    public RespResult queryContractsByTodayByPage(int currentPage, int pageSize) {
        QueryWrapper<CrmContract> contractQueryWrapper = new QueryWrapper<>();
        contractQueryWrapper.eq("deleted_state", Constants.UNDELETED)
                .ge("enter_date", TimeSlotUtil.getTimesmorning())
                .le("enter_date",TimeSlotUtil.getTimesnight());
        Page<CrmContract> page = new Page<>(currentPage,pageSize);
        IPage<CrmContract> crmContractIPage = contractMapper.selectPage(page, contractQueryWrapper);
        List<ContractDTO> contractDTOList = getContractVO(crmContractIPage.getRecords());
        return RespResult.success(contractDTOList);
    }

    /**
     * 查询本周新增的合同列表
     * @param currentPage
     * @param pageSize
     * @return
     */
    @Override
    public RespResult queryContractsByWeekByPage(int currentPage, int pageSize) {
        QueryWrapper<CrmContract> contractQueryWrapper = new QueryWrapper<>();
        contractQueryWrapper.ge("enter_date",TimeSlotUtil.getTimesWeekmorning())
                .le("enter_date",TimeSlotUtil.getTimesWeeknight())
                .eq("deleted_state", Constants.UNDELETED);
        Page<CrmContract> page = new Page<>(currentPage,pageSize);
        IPage<CrmContract> crmContractIPage = contractMapper.selectPage(page, contractQueryWrapper);
        List<ContractDTO> contractDTOList = getContractVO(crmContractIPage.getRecords());
        return RespResult.success(contractDTOList);
    }

    /**
     * 查询本月新增的合同列表
     * @param currentPage
     * @param pageSize
     * @return
     */
    @Override
    public RespResult queryContractsByMonthByPage(int currentPage, int pageSize) {
        QueryWrapper<CrmContract> contractQueryWrapper = new QueryWrapper<>();
        contractQueryWrapper.ge("enter_date",TimeSlotUtil.getTimesMonthmorning())
                .le("enter_date",TimeSlotUtil.getTimesMonthnight())
                .eq("deleted_state", Constants.UNDELETED);
        Page<CrmContract> page = new Page<>(currentPage,pageSize);
        IPage<CrmContract> crmContractIPage = contractMapper.selectPage(page, contractQueryWrapper);
        List<ContractDTO> contractDTOList = getContractVO(crmContractIPage.getRecords());
        return RespResult.success(contractDTOList);
    }

    /**
     * 查询今日到期的合同列表
     * @param currentPage
     * @param pageSize
     * @return
     */
    @Override
    public RespResult queryContractsByDueTodayByPage(int currentPage, int pageSize) {
        QueryWrapper<CrmContract> contractQueryWrapper = new QueryWrapper<>();
        contractQueryWrapper.ge("expiration_date",TimeSlotUtil.getTimesmorning())
                .le("expiration_date",TimeSlotUtil.getTimesnight())
                .eq("deleted_state", Constants.UNDELETED);
        Page<CrmContract> page = new Page<>(currentPage,pageSize);
        IPage<CrmContract> crmContractIPage = contractMapper.selectPage(page, contractQueryWrapper);
        List<ContractDTO> contractDTOList = getContractVO(crmContractIPage.getRecords());
        return RespResult.success(contractDTOList);
    }

    /**
     * 查询本周到期的合同列表
     * @param currentPage
     * @param pageSize
     * @return
     */
    @Override
    public RespResult queryContractsByDueWeekByPage(int currentPage, int pageSize) {
        QueryWrapper<CrmContract> contractQueryWrapper = new QueryWrapper<>();
        contractQueryWrapper.ge("expiration_date",TimeSlotUtil.getTimesWeekmorning())
                .le("expiration_date",TimeSlotUtil.getTimesWeeknight())
                .eq("deleted_state", Constants.UNDELETED);
        Page<CrmContract> page = new Page<>(currentPage,pageSize);
        IPage<CrmContract> crmContractIPage = contractMapper.selectPage(page, contractQueryWrapper);
        List<ContractDTO> contractDTOList = getContractVO(crmContractIPage.getRecords());
        return RespResult.success(contractDTOList);
    }

    /**
     * 查询本月到期的合同列表
     * @param currentPage
     * @param pageSize
     * @return
     */
    @Override
    public RespResult queryContractsByDueMonthByPage(int currentPage, int pageSize) {
        QueryWrapper<CrmContract> contractQueryWrapper = new QueryWrapper<>();
        contractQueryWrapper.ge("expiration_date",TimeSlotUtil.getTimesMonthmorning())
                .le("expiration_date",TimeSlotUtil.getTimesMonthnight())
                .eq("deleted_state", Constants.UNDELETED);
        Page<CrmContract> page = new Page<>(currentPage,pageSize);
        IPage<CrmContract> crmContractIPage = contractMapper.selectPage(page, contractQueryWrapper);
        List<ContractDTO> contractDTOList = getContractVO(crmContractIPage.getRecords());
        return RespResult.success(contractDTOList);
    }

    /**
     * 新增合同
     * @param contractDTO
     * @return
     */
    @Override
    public RespResult insertContract(ContractDTO contractDTO) {
        QueryWrapper<CrmContract> crmContractQueryWrapper = new QueryWrapper<>();
        crmContractQueryWrapper.eq("contract_id",contractDTO.getContractId());
        CrmContract selectedCrmContract = contractMapper.selectOne(crmContractQueryWrapper);
        if(selectedCrmContract == null){
            CrmContract crmContract = getCrmContract(contractDTO);
            contractMapper.insert(crmContract);
            return RespResult.success();
        }
        return RespResult.error("合同已存在");
    }

    /**
     * 新增合同类型
     * @param crmContractType
     * @return
     */
    @Override
    public RespResult insertContractType(CrmContractType crmContractType) {
        QueryWrapper<CrmContractType> crmContractTypeQueryWrapper = new QueryWrapper<>();
        crmContractTypeQueryWrapper.eq("type",crmContractType.getType());
        CrmContractType selectedContractType = contractTypeMapper.selectOne(crmContractTypeQueryWrapper);
        if (selectedContractType == null){
            contractTypeMapper.insert(crmContractType);
            return RespResult.success();
        }
        return RespResult.error("合同类型已存在");
    }

    /**
     * 查询合同类型
     * @return
     */
    @Override
    public RespResult selectContractTypes() {
        List<CrmContractType> crmContractTypeList = contractTypeMapper.selectList(null);
        return RespResult.success(crmContractTypeList);
    }

    /**
     * 修改合同类型
     * @param crmContractType
     * @return
     */
    @Override
    public RespResult reviseContractType(CrmContractType crmContractType) {
        UpdateWrapper<CrmContractType> crmContractTypeUpdateWrapper = new UpdateWrapper<>();
        crmContractTypeUpdateWrapper.eq("id",crmContractType.getId())
                        .set("type",crmContractType.getType());
        int result = contractTypeMapper.update(null,crmContractTypeUpdateWrapper);
        if(result > 0){
            return RespResult.success();
        }
        return RespResult.error("修改失败");
    }

    /**
     * 删除合同类型
     * @param id
     * @return
     */
    @Override
    public RespResult deleteContractType(int id) {
        QueryWrapper<CrmContractType> crmContractTypeQueryWrapper = new QueryWrapper<>();
        crmContractTypeQueryWrapper.eq("id",id);
        contractTypeMapper.delete(crmContractTypeQueryWrapper);
        return RespResult.success();
    }

    /**
     * 新增合同续费记录
     * @param renewalRecordDTO
     * @return
     */
    @Override
    public RespResult addRenewal(RenewalRecordDTO renewalRecordDTO) {
        CrmRenewalRecord crmRenewalRecord =  getCrmRenewalRecord(renewalRecordDTO);
        renewalRecordMapper.insert(crmRenewalRecord);
        return RespResult.success();
    }

    /**
     * 修改合同续费记录
     * @param renewalRecordDTO
     * @return
     */
    @Override
    public RespResult updateRenewal(RenewalRecordDTO renewalRecordDTO) {
        CrmRenewalRecord crmRenewalRecord =  getCrmRenewalRecord(renewalRecordDTO);
        crmRenewalRecord.setId(renewalRecordDTO.getId());
        int result = renewalRecordMapper.updateRenewal(crmRenewalRecord);
        if(result > 0){
            return RespResult.success();
        }
        return RespResult.error("修改失败");
    }

    /**
     * 删除合同续费记录
     * @param id
     * @return
     */
    @Override
    public RespResult deleteRenewal(int id) {
        int result = renewalRecordMapper.deleteById(id);
        if(result > 0){
            return RespResult.success();
        }
        return RespResult.error("删除失败");
    }

    /**
     * 修改续费状态
     * @param id
     * @param status
     * @return
     */
    @Override
    public RespResult updateRenewalStatus(int id, String status) {
        UpdateWrapper<CrmRenewalRecord> crmRenewalRecordUpdateWrapper = new UpdateWrapper<>();
        crmRenewalRecordUpdateWrapper.eq("id",id)
                .set("status",status);
        int result = renewalRecordMapper.update(null,crmRenewalRecordUpdateWrapper);
        if(result > 0){
            return RespResult.success();
        }
        return RespResult.error("修改失败");
    }

    /**
     * 查询合同对应的续费记录
     * @param contractId
     * @param currentPage
     * @param pageSize
     * @return
     */
    @Override
    public RespResult queryRenewals(String contractId, int currentPage, int pageSize) {
        QueryWrapper<CrmRenewalRecord> crmRenewalRecordQueryWrapper = new QueryWrapper<>();
        crmRenewalRecordQueryWrapper.eq("contract_id",contractId);
        Page<CrmRenewalRecord> page = new Page<>(currentPage,pageSize);
        IPage<CrmRenewalRecord> crmRenewalRecordIPage = renewalRecordMapper.selectPage(page,crmRenewalRecordQueryWrapper);
        List<RenewalRecordDTO> renewalRecordDTOList = new ArrayList<>();
        for (CrmRenewalRecord crmRenewalRecord : crmRenewalRecordIPage.getRecords()){
            //根据业务人员的编号查询业务人员的名称
            String businessName = getEmployeeNameByEmployeeId(crmRenewalRecord.getBusinessId());
            RenewalRecordDTO renewalRecordDTO = new RenewalRecordDTO(crmRenewalRecord.getId(),
                    contractId,crmRenewalRecord.getNewExpirationDate(),crmRenewalRecord.getMoney(),
                    crmRenewalRecord.getPayment(),crmRenewalRecord.getRemark(),businessName,crmRenewalRecord.getName());
            renewalRecordDTOList.add(renewalRecordDTO);
        }
        return RespResult.success(renewalRecordDTOList);
    }

    /**
     * 到款
     * @param contractId 合同编号
     * @param payment
     * @param remark
     * @return
     */
    @Override
    public RespResult paymentReceived(String contractId, BigDecimal payment, String remark) {
        //先根据合同编号查询合同信息
        QueryWrapper<CrmContract> contractQueryWrapper = new QueryWrapper<>();
        contractQueryWrapper.eq("contract_id",contractId);
        CrmContract crmContract = contractMapper.selectOne(contractQueryWrapper);
        BigDecimal newPayment = crmContract.getPayment().add(payment);
        if(crmContract.getMoney().compareTo(newPayment) > -1){
            //表示总金额大于等于已付款
            BigDecimal newDebt =  crmContract.getDebt().subtract(payment);
            //修改合同记录
            UpdateWrapper<CrmContract> crmContractUpdateWrapper = new UpdateWrapper<>();
            crmContractUpdateWrapper.set("payment",newPayment)
                    .set("debt",newDebt).eq("contract_id",contractId);
            contractMapper.update(null,crmContractUpdateWrapper);
            return RespResult.success();
        }
        return RespResult.error("到款金额不合法");
    }

    /**
     * 修改合同
     * @param contractDTO
     * @return
     */
    @Override
    public RespResult updateContract(ContractDTO contractDTO) {
        CrmContract crmContract = getCrmContract(contractDTO);
        int result =  contractMapper.updateContract(crmContract);
        if(result > 0){
            return RespResult.success();
        }
        return RespResult.error("修改失败");
    }

    /**
     * 删除合同
     * @param contractId
     * @return
     */
    @Override
    public RespResult deleteContract(String contractId) {
        QueryWrapper<CrmContract> contractQueryWrapper = new QueryWrapper<>();
        contractQueryWrapper.eq("contract_id",contractId);
        contractMapper.delete(contractQueryWrapper);
        return RespResult.success();
    }

    /**
     * 修改合同状态
     * @param contractId
     * @param status
     * @param auditorId
     * @return
     */
    @Override
    public RespResult updateContractStatus(String contractId, String status, int auditorId) {
        UpdateWrapper<CrmContract> contractUpdateWrapper = new UpdateWrapper<>();
        contractUpdateWrapper.set("status",status).set("auditor_id",auditorId)
                .set("auditor_date",new Date()).eq("contract_id",contractId);
        contractMapper.update(null,contractUpdateWrapper);
        return RespResult.success();
    }

    /**
     * 按条件（客户名称、合同编号）搜索合同列表
     * @param condition
     * @return
     */
    @Override
    public RespResult queryContractByCondition(String condition) {
        LambdaQueryWrapper<CrmContract> contractLambdaQueryWrapper = new LambdaQueryWrapper<>();
        //根据客户名称查询客户编号
        LambdaQueryWrapper<MyCustomerDTO> customerDTOLambdaQueryWrapper = new LambdaQueryWrapper<>();
        customerDTOLambdaQueryWrapper.eq(MyCustomerDTO::getCustomerName,condition);
        MyCustomerDTO myCustomerDTO = myCustomerMapper.selectOne(customerDTOLambdaQueryWrapper);
        Integer customerId = 0;
        if(myCustomerDTO != null){
            customerId = myCustomerDTO.getCustomerId();
        }
        if(customerId == 0){
            contractLambdaQueryWrapper.eq(CrmContract::getContractId,condition);
        }else {
            contractLambdaQueryWrapper.eq(CrmContract::getCustomerId,customerId);
        }
        List<CrmContract> crmContractList = contractMapper.selectList(contractLambdaQueryWrapper);
        List<ContractDTO> contractDTOList = getContractVO(crmContractList);
        return RespResult.success(contractDTOList);
    }

    /**
     * 高级搜索合同列表
     * @param advancedContractDTO
     * @param currentPage
     * @param pageSize
     * @return
     */
    @Override
    public RespResult advancedQueryContracts(AdvancedContractDTO advancedContractDTO, int currentPage, int pageSize) {
        //根据客户名称查询客户编号
        LambdaQueryWrapper<MyCustomerDTO> customerDTOLambdaQueryWrapper = new LambdaQueryWrapper<>();
        customerDTOLambdaQueryWrapper.eq(MyCustomerDTO::getCustomerName,advancedContractDTO.getCustomerName());
        MyCustomerDTO myCustomerDTO = myCustomerMapper.selectOne(customerDTOLambdaQueryWrapper);
        Integer customerId = 0;
        if(myCustomerDTO != null){
            customerId = myCustomerDTO.getCustomerId();
        }
        //根据合同类型查询合同编号
        QueryWrapper<CrmContractType> contractTypeQueryWrapper = new QueryWrapper<>();
        contractTypeQueryWrapper.eq("type",advancedContractDTO.getType());
        CrmContractType crmContractType = contractTypeMapper.selectOne(contractTypeQueryWrapper);
        Integer contractTypeId = 0;
        if(crmContractType != null){
            contractTypeId = crmContractType.getId();
        }
        Integer debt = 0;
        if(advancedContractDTO.getIsDebt() != null){
            if("有".equals(advancedContractDTO.getIsDebt())){
                debt = 1;
            }else if("无".equals(advancedContractDTO.getIsDebt())){
                debt = -1;
            }
        }
        //根据业务人员的名字查询业务人员编号
        Integer businessId = getEmployeeIdByEmployeeName(advancedContractDTO.getBusinessName());
        AdvancedContract2DTO advancedContract2DTO = new AdvancedContract2DTO(advancedContractDTO.getId(),
                advancedContractDTO.getContractId(),customerId,contractTypeId,advancedContractDTO.getStartDate1(),
                advancedContractDTO.getStartDate2(),advancedContractDTO.getExpirationDate1(),advancedContractDTO.getExpirationDate2(),
                advancedContractDTO.getStatus(),debt,businessId,advancedContractDTO.getEnterDate1(),advancedContractDTO.getEnterDate2(),
                advancedContractDTO.getRemark());
        return null;
    }

    /**
     * 根据员工编号查询员工名称
     * @param employeeId
     * @return
     */
    public String getEmployeeNameByEmployeeId(int employeeId){
        QueryWrapper<Employee> employeeQueryWrapper = new QueryWrapper<>();
        employeeQueryWrapper.eq("employee_id",employeeId);
        Employee employee = myEmployeeMapper.selectOne(employeeQueryWrapper);
        String name = null;
        if(employee != null){
            name = employee.getEmployeeName();
        }
        return name;
    }

    /**
     * 根据CrmContract创建实例化ContractVO
     * @param contractLists
     * @return
     */
    public List<ContractDTO> getContractVO(List<CrmContract> contractLists){
        List<ContractDTO> contractDTOList = new ArrayList<>();
        for(CrmContract crmContract : contractLists){
            //根据合同中的客户编号查询客户信息
            QueryWrapper<MyCustomerDTO> crmCustomerQueryWrapper = new QueryWrapper<>();
            crmCustomerQueryWrapper.eq("customer_id",crmContract.getCustomerId());
            MyCustomerDTO myCustomerDTO = myCustomerMapper.selectOne(crmCustomerQueryWrapper);
            String customerName = null;
            if(myCustomerDTO != null){
                customerName = myCustomerDTO.getCustomerName();
            }
            //根据合同中的合同类型编号查询合同类型信息
            QueryWrapper<CrmContractType> crmContractTypeQueryWrapper = new QueryWrapper<>();
            crmContractTypeQueryWrapper.eq("id",crmContract.getTypeId());
            CrmContractType crmContractType = contractTypeMapper.selectOne(crmContractTypeQueryWrapper);
            String contractType = null;
            if(crmContractType != null){
                contractType = crmContractType.getType();
            }
            //获取业务人员名称
            String businessName = getEmployeeNameByEmployeeId(crmContract.getBusinessId().intValue());
            //获取审核人员名称
            String auditorName = null;
            if(crmContract.getAuditorId() != null){
                 auditorName = getEmployeeNameByEmployeeId(crmContract.getAuditorId().intValue());
            }
            //查询对应合同关联的附件
            QueryWrapper<CrmAppendix> queryWrapper = new QueryWrapper<>();
            queryWrapper.eq("appendix_relevance_id",crmContract.getId());
            List<CrmAppendix> crmAppendixList = contractAppendixMapper.selectList(queryWrapper);
            Integer fileNumber = 0;
            if(crmAppendixList !=null){
               fileNumber = crmAppendixList.size();
            }
            //创建并实例化合同VO对象
            ContractDTO contractDTO = new ContractDTO(crmContract.getContractId(),customerName,crmContract.getOrderId(),
                    contractType,crmContract.getStartDate(),crmContract.getExpirationDate(),crmContract.getMoney(),
                    crmContract.getPayment(),crmContract.getDebt(),crmContract.getStatus(),crmContract.getIsReceipt(),crmContract.getIsTax(),crmContract.getRemark(),
                    businessName,crmContract.getEnterDate(),crmContract.getAuditorDate(),auditorName,fileNumber);
            contractDTOList.add(contractDTO);
        }
        return contractDTOList;
    }

    /**
     * 根据员工名称查询员工编号
     * @param employeeName
     * @return
     */
    public Integer getEmployeeIdByEmployeeName(String employeeName){
        QueryWrapper<Employee> employeeQueryWrapper = new QueryWrapper<>();
        employeeQueryWrapper.eq("employee_name",employeeName);
        Employee employee = myEmployeeMapper.selectOne(employeeQueryWrapper);
        Integer employeeId = 0;
        if(employee != null){
            employeeId = employee.getEmployeeId();
        }
        return employeeId;
    }

    /**
     * 根据contractDTO创建实例化CrmContract
     * @param contractDTO
     * @return
     */
    public CrmContract getCrmContract(ContractDTO contractDTO){
        //根据客户名称查询客户编号
        QueryWrapper<MyCustomerDTO> myCustomerDTOQueryWrapper = new QueryWrapper<>();
        myCustomerDTOQueryWrapper.eq("customer_name",contractDTO.getCustomerName());
        MyCustomerDTO myCustomerDTO = myCustomerMapper.selectOne(myCustomerDTOQueryWrapper);
        Integer customerId = 0;
        if(myCustomerDTO != null){
            customerId = myCustomerDTO.getCustomerId();
        }
        //根据合同类型查询合同类型编号
        QueryWrapper<CrmContractType> crmContractTypeQueryWrapper = new QueryWrapper<>();
        crmContractTypeQueryWrapper.eq("type",contractDTO.getType());
        CrmContractType crmContractType = contractTypeMapper.selectOne(crmContractTypeQueryWrapper);
        Integer contractTypeId = 0;
        if(crmContractType != null){
            contractTypeId = crmContractType.getId();
        }
        //根据业务人员名称获取业务人员编号
        Integer businessId = getEmployeeIdByEmployeeName(contractDTO.getBusinessName());
        CrmContract crmContract = new CrmContract(contractDTO.getContractId(),customerId,contractDTO.getOrderId(),
                contractTypeId,contractDTO.getStartDate(),contractDTO.getExpirationDate(),contractDTO.getMoney(),
                contractDTO.getPayment(),contractDTO.getDebt(),contractDTO.getStatus(),contractDTO.getIsReceipt(),
                contractDTO.getIsTax(),contractDTO.getRemark(),businessId,contractDTO.getEnterDate(),Constants.UNDELETED);
        return crmContract;
    }

    public CrmRenewalRecord getCrmRenewalRecord(RenewalRecordDTO renewalRecordDTO){
        //根据业务人员的名称查询对应的编号
        Integer businessId = getEmployeeIdByEmployeeName(renewalRecordDTO.getEmployeeName());
        CrmRenewalRecord crmRenewalRecord = new CrmRenewalRecord(renewalRecordDTO.getContractId(),renewalRecordDTO.getNewExpirationDate(),
                renewalRecordDTO.getMoney(),renewalRecordDTO.getPayment(),renewalRecordDTO.getRemark(),businessId,Constants.PAYMENT_STATUS,
                new Date(),Constants.UNDELETED,renewalRecordDTO.getName());
        return crmRenewalRecord;
    }
}
